using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;
using System.IO;

using ExchangeHog.Pop3Client.Responses;

namespace ExchangeHog.Pop3Client.Commands
{
    internal sealed class UserCommand : Pop3Command<Pop3Response>
    {
        private string username;

        public UserCommand(Stream stream, string username): base(stream, false, Pop3State.Authorization)
        {
            if (string.IsNullOrEmpty(username))
                throw new ArgumentNullException("username");

            this.username = username;
        }

        protected override byte[] CreateRequestMessage() { return GetRequestMessage(Pop3Commands.User, username, Pop3Commands.Crlf); }
    }
}
